﻿@model cloudscribe.Core.IdentityServerIntegration.Models.IdentityEditViewModel
@using cloudscribe.Core.IdentityServerIntegration.Models
@using cloudscribe.Core.IdentityServerIntegration
@inject ICoreThemeHelper themeHelper
@inject IStringLocalizer<CloudscribeIds4Resources> sr
@{
    var themeSettings = themeHelper.GetThemeSettings();
    if (themeSettings.AdminSideNavExpanded) { ViewData["SideNavToggle"] = "show"; }
    ViewData["SideNavVisible"] = true;
    IdentityItemViewModel editModel = null;
    if(Model.CurrentResource != null)
    {
        editModel = new IdentityItemViewModel(Model.SiteId, Model.CurrentResource);
    }
}

@if (Model.CurrentResource == null)
{
    <h2>@ViewData["Title"]</h2>
    <partial name="NewResourcePartial" model="Model.NewResource" />
}
else
{
    <h2>@ViewData["Title"]</h2>
    <partial name="EditResourcePartial" model="@editModel" />
    <partial name="IdentityClaimsPartial" model="Model" />

}

@section SideNav {
    <partial name="AdminSideNav" />
}
@section Toolbar{
    <partial name="AdminSideNavToggle" />
}
@section Scripts {
    <partial name="AdminSideNavScripts" />
    <script src="~/cr/js/jquery.validate.min.js"></script>
    <script src="~/cr/js/jquery.validate.unobtrusive.min.js"></script>
    <script src="~/cr/js/unobtrusive-validation-bs4.min.js"></script>
}
